package com.gxa.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.stereotype.Component;

/**
 * 有Count的返回类
 */
@ApiModel(value = "结果返回类")
@Component
public class Q<T> {
    @ApiModelProperty(name = "code",notes = "返回提示码",dataType = "Integer",required = true)
    private Integer code;
    @ApiModelProperty(name = "msg",notes = "解释文本",dataType = "String",required = true)
    private String msg;
    @ApiModelProperty(name = "code",notes = "查询结果条数",dataType = "Integer",required = false)
    private Integer count;
    @ApiModelProperty(name = "code",notes = "返回查询结果",dataType = "json",required = true)
    private T data;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Q{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", count=" + count +
                ", data=" + data +
                '}';
    }
}
